#include "_defines.vsh"

//*********************************************************
// This is morphing, really... :)
//
// Input Registers used:
//   v0 - The vertex position
//   v1 - The vertex normal
//   v2 - The vertex UV
//   v3 - The vertex u-tangent
//   v4 - The vertex v-tangent
//   v5 - The vertex position
//   v6 - The vertex normal
//   v7 - The vertex UV
//   v8 - The vertex u-tangent
//   v9 - The vertex v-tangent
//
// Output Registers used:
//   inPos - The vertex position
//   inNormal - The vertex normal
//   inUV
//
// Constant Registers used:
//   c[model_view_projection(4)] - Model view projection matrix.
//   c[WORLD_MATRIX+...] - Joint0 relative matrices.
//
//*********************************************************

def c[CONSTANT_0_05_1_2], 0, 0.5, 1, 2

;mov inPos, v0
;mov inNormal, v1
;mov inUV, v2

mul inPos, c[MORPH_WEIGHT_MW_1MINUSMW_0_ISFOGOPAQUE].y, v0
mad inPos, c[MORPH_WEIGHT_MW_1MINUSMW_0_ISFOGOPAQUE].x, v5, inPos

mul inNormal, c[MORPH_WEIGHT_MW_1MINUSMW_0_ISFOGOPAQUE].y, v1
mad inNormal, c[MORPH_WEIGHT_MW_1MINUSMW_0_ISFOGOPAQUE].x, v6, inNormal

mul inUV, c[MORPH_WEIGHT_MW_1MINUSMW_0_ISFOGOPAQUE].y, v2
mad inUV, c[MORPH_WEIGHT_MW_1MINUSMW_0_ISFOGOPAQUE].x, v7, inUV

// normalize normals
;dp3 inNormal.w, inNormal, inNormal
;rsq inNormal.w, inNormal.w
;mul inNormal.xyz, inNormal, inNormal.w

